package com.ruoyi.project.wf.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.project.wf.service.IWfProcessActRoleRelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.wf.mapper.WfProcessActRoleRelMapper;
import com.ruoyi.project.wf.domain.WfProcessActRoleRel;
import com.ruoyi.common.utils.text.Convert;

/**
 * 流程项角色关系Service业务层处理
 *
 * @author XQ.XU
 * @date 2020-03-26
 */
@Service
public class WfProcessActRoleRelServiceImpl extends ServiceImpl<WfProcessActRoleRelMapper, WfProcessActRoleRel> implements IWfProcessActRoleRelService
{
    @Autowired
    private WfProcessActRoleRelMapper wfProcessActRoleRelMapper;

    /**
     * 查询流程项角色关系
     *
     * @param id 流程项角色关系ID
     * @return 流程项角色关系
     */
    @Override
    public WfProcessActRoleRel selectWfProcessActRoleRelById(String id)
    {
        return wfProcessActRoleRelMapper.selectWfProcessActRoleRelById(id);
    }

    /**
     * 查询流程项角色关系列表
     *
     * @param wfProcessActRoleRel 流程项角色关系
     * @return 流程项角色关系
     */
    @Override
    public List<WfProcessActRoleRel> selectWfProcessActRoleRelList(WfProcessActRoleRel wfProcessActRoleRel)
    {
        return wfProcessActRoleRelMapper.selectWfProcessActRoleRelList(wfProcessActRoleRel);
    }

    /**
     * 新增流程项角色关系
     *
     * @param wfProcessActRoleRel 流程项角色关系
     * @return 结果
     */
    @Override
    public int insertWfProcessActRoleRel(WfProcessActRoleRel wfProcessActRoleRel)
    {
        wfProcessActRoleRel.setCreateTime(DateUtils.getNowDate());
        return wfProcessActRoleRelMapper.insertWfProcessActRoleRel(wfProcessActRoleRel);
    }

    /**
     * 修改流程项角色关系
     *
     * @param wfProcessActRoleRel 流程项角色关系
     * @return 结果
     */
    @Override
    public int updateWfProcessActRoleRel(WfProcessActRoleRel wfProcessActRoleRel)
    {
        wfProcessActRoleRel.setUpdateTime(DateUtils.getNowDate());
        return wfProcessActRoleRelMapper.updateWfProcessActRoleRel(wfProcessActRoleRel);
    }

    /**
     * 删除流程项角色关系对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWfProcessActRoleRelByIds(String ids)
    {
        return wfProcessActRoleRelMapper.deleteWfProcessActRoleRelByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除流程项角色关系信息
     *
     * @param id 流程项角色关系ID
     * @return 结果
     */
    @Override
    public int deleteWfProcessActRoleRelById(String id)
    {
        return wfProcessActRoleRelMapper.deleteWfProcessActRoleRelById(id);
    }
}
